package com.schoolcloud.social.controller.event;

import com.schoolcloud.common.model.R;
import com.schoolcloud.social.entity.SocEventMien;
import com.schoolcloud.social.service.SocEventMienService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/social/event/mien")
@RequiredArgsConstructor
public class SocEventMienController {
    private final SocEventMienService socEventMienService;
    @GetMapping("/eventId/{eventId}")
    public R<List<SocEventMien>> getEventListByEventId(@PathVariable String eventId){
        return R.ok(socEventMienService.getEventListByEventId(eventId));
    }
    @PostMapping
    public R addEventMien(@RequestBody SocEventMien socEventMien){
        socEventMienService.save(socEventMien);
        return R.ok();
    }
}
